import tornado.web
import tornado.httpclient
from tornado.web import Application
import tornado.ioloop
class MainHandler(tornado.web.RequestHandler):


    @tornado.gen.coroutine
    def get(self):
        http=tornado.httpclient.AsyncHTTPClient()
        response=yield http.fetch("http://www.baidu.com")
        self.write(response.body)

if __name__ == '__main__':
    app=Application([
        ("/",MainHandler)
    ])
    app.listen("8888")
    tornado.ioloop.IOLoop.current().start()
